<?php
/** Normal Diff */
class LuminousGrammarDiff extends LuminousGrammar
{

  
  function __construct()
  {
    $this->SetInfoAuthor( 
    array('name'=>'Mark Watkinson', 'email'=>'markwatkinson@gmail.com',
    'website'=>'http://www.asgaard.co.uk'));
    $this->SetInfoLanguage('diff');
    $this->SetInfoVersion('0.4.0');        
    
    $this->simple_types = array(
      new LuminousSimpleRule(1, 'DIFF_RANGE', LUMINOUS_REGEX, 
        '/^[0-9]+(?:,[0-9]+)?[acd]?[0-9]+(,[0-9]+)?$/mi'),
      new LuminousSimpleRule(0, 'DIFF_OLD', LUMINOUS_REGEX,
        '/^&lt;.*$/mi'),
      new LuminousSimpleRule(0, 'DIFF_NEW', LUMINOUS_REGEX,
        '/^\&gt;.*$/mi')
    );
    
  }
}


/** Unified Diff */
class LuminousGrammarUDiff extends LuminousGrammar
{

  
  function __construct()
  {
    
    $this->SetInfoAuthor( 
    array('name'=>'Mark Watkinson', 'email'=>'markwatkinson@gmail.com',
    'website'=>'http://www.asgaard.co.uk'));
    $this->SetInfoLanguage('udiff');
    $this->SetInfoVersion('0.4.0');        
    
    $this->simple_types = array(
      new LuminousSimpleRule(1, 'DIFF_HEADER_NEW', LUMINOUS_REGEX,
        '/^\+{3}.*$/mi'),
        
      new LuminousSimpleRule(1, 'DIFF_HEADER_OLD', LUMINOUS_REGEX,
       '/^\-{3}.*$/mi'),        
        
      new LuminousSimpleRule(1, 'DIFF_RANGE', LUMINOUS_REGEX, 
        '/^@@.*@@$/mi'),
        
      new LuminousSimpleRule(0, 'DIFF_OLD', LUMINOUS_REGEX,
        '/^\-[^\-].*$/mi'),
        
      new LuminousSimpleRule(0, 'DIFF_NEW', LUMINOUS_REGEX,
       '/^\+[^\+].*$/mi')
    );
    
  }  
}